<template>
    <div class="company-container">
      <!--标题-->
      <section-title :title="title"></section-title>
      <!--表单-->
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="昵称" prop="nickname">
          <el-input v-model="ruleForm.nickname"></el-input>
        </el-form-item>
        <el-form-item label="真实姓名" prop="name">
          <el-input v-model="ruleForm.name"></el-input>
        </el-form-item>
        <el-form-item label="年龄" prop="age">
          <el-input v-model="ruleForm.age"></el-input>
        </el-form-item>
        <el-form-item label="性别" prop="sex">
          <el-input v-model="ruleForm.sex"></el-input>
        </el-form-item>
        <el-form-item label="联系方式" prop="phone">
          <el-input v-model="ruleForm.phone" placeholder="手机号码"></el-input>
        </el-form-item>
        <el-form-item label="邮箱" prop="email">
          <el-input v-model="ruleForm.email"></el-input>
        </el-form-item>
        <el-form-item label="QQ" prop="tencentQq">
          <el-input v-model="ruleForm.tencentQq"></el-input>
        </el-form-item>
        <el-form-item label="现居地" prop="address">
          <el-input v-model="ruleForm.address"></el-input>
        </el-form-item>
        <el-form-item label="您是？" prop="type">
          <el-select v-model="ruleForm.type" placeholder="请选择您的职业">
            <el-option label="杞农" name="type" value="0"></el-option>
            <el-option label="经销商" name="type" value="1"></el-option>
            <el-option label="生产厂商" name="type" value="2"></el-option>
            <el-option label="枸杞从业者" name="type" value="4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="您是？" prop="">
          <el-select v-model="ruleForm.type" placeholder="请选择您的职业">
            <el-option label="农民" name="type" value="0"></el-option>
            <el-option label="采购商" name="type" value="1"></el-option>
            <el-option label="生产商" name="type" value="2"></el-option>
            <el-option label="枸杞从业者" name="type" value="4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')">保存信息</el-button>
          <!--<el-button @click="resetForm('ruleForm')">重置信息</el-button>-->
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
import SectionTitle from '../../components/title/SectionTitle'
import {getUserId} from '../../libs/util'
import {getCurrentStringTime} from '../../utils/dateUtils'

export default {
  name: 'CompanyComponent',
  components: {SectionTitle},
  data () {
    return {
      title: {
        line: true,
        icon: '',
        name: '基本资料',
        editable: true
      },
      ruleForm: {
        message: '',
        type: '',
        phone: '',
        address: '',
        desc: '',
        userId: getUserId(),
        imageDesc: '',
        createTime: getCurrentStringTime()
      },
      rules: {
        message: [
          {required: true, message: '请输入活动名称', trigger: 'blur'},
          {min: 5, max: 20, message: '长度在 5 到 20 个字符', trigger: 'blur'}
        ],
        type: [
          {required: true, message: '请选择发布信息类型', trigger: 'change'}
        ],
        phone: [
          {required: true, message: '请填写联系电话', trigger: 'change'}
        ],
        address: [
          {required: true, message: '请填写联系地址', trigger: 'change'}
        ],
        descInfo: [
          {required: true, message: '请填写信息详情', trigger: 'blur'}
        ],
        imageDesc: [
          {required: true, message: '请添加图片详情', trigger: 'blur'}
        ]
      }
    }
  }
}
</script>

<style scoped>

</style>
